package com.neuedu.mblog.controller;

import com.neuedu.mblog.entiry.Channel;
import com.neuedu.mblog.service.ChannelService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

/**
 * 项目：mblog_java4
 * 创建时间：  2022-01-02   10:19
 * 作者 :jshand
 * 描述 : 文章的操作
 *
 * /post 不需要登录
 * /post/edit
 */
@WebServlet(urlPatterns = "/post")
public class PostController extends  BaseController {
    private ChannelService channelService = new ChannelService();

    /**
     * /post?_type=editing
     * 前台用户编辑文章
     * @param request
     * @param response
     */
    public void editing(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException {
        List<Channel> channelList = channelService.selectList(request);
        request.setAttribute("channelList",channelList);
        request.getRequestDispatcher("/WEB-INF/view/front/post/editing.jsp").forward(request,response);
    }


}
